package com.iotstudio.embeddedcloudplatform.service;

import com.alibaba.fastjson.JSONArray;
import com.iotstudio.embeddedcloudplatform.POJO.DO.Sensor;
import com.iotstudio.embeddedcloudplatform.POJO.DO.SensorData;
import com.iotstudio.embeddedcloudplatform.POJO.DO.UserSensor;
import com.iotstudio.embeddedcloudplatform.POJO.VO.ResultVO;
import com.iotstudio.embeddedcloudplatform.util.page.ListUtil;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * 传感器service
 * @author BeFondOfTaro
 * Created at 17:39 2018/1/19
 */
public interface SensorService {
    /**
     * 添加传感器
     * @param sensor 传感器信息
     * @return
     */
    ModelAndView add(UserSensor userSensor);

    /**
     * 传输传感器数据
     * @param sensorData 传感器数据
     * @param sensorDataType 传感器数据类型
     * @return
     */
    ResultVO dataTransmission(SensorData sensorData, String name);

    /**
     * 删除传感器
     * @param id 传感器id
     * @param name 传感器类型名
     * @return
     */
    ResultVO deleteSensor(String id,String name);

    /**
     * 展示传感器数据
     * @return
     */
    Object showSensorData(String sensorId);
    /**
     * 根据sensorId查传感器
     */
    Sensor getSensor(String sensorId);

    JSONArray getSensorData(String sensorId);
}
